﻿<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" />
    <meta name="msapplication-TileColor" content="#090a0a">
    <link rel="stylesheet" href="__ROOT__/static/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="__ROOT__/static/home/css/css_style.css">
    <script type="text/javascript" src="__ROOT__/static/plugins/jquery-3.2.1/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/layer.js"></script>
    <script type="text/javascript" src="__ROOT__/static/plugins/bootstrap/js/bootstrap.min.js"></script>
</head>
<body class="grayBy">
<div class="search_community_header">
    <a href="{:url('home/Topics/TopicDetails', array('id'=> $community_id))}"><span class="category_community"><img style="width: 10px;height: 20px;" src="__ROOT__/static/home/css/myorder/images/back.png"/></span></a>
    <span class="search_topics">详情</span>
    <a href=""><span class="search_topics_icon"></span></a>
</div>
<ul class="address_list">
    <li>
        <div>
            <p><b><span>标题：</span>{$topicDetails.title}</b></p>
            <input type="hidden" id="topic_id" value="{$topicDetails.id}"/>
            <div style="width: 100%">
                <img  style="width: 100%;" src="__ROOT__{$topicDetails.topic_url}"/>
            </div>
            <p class=""><span>内容：</span><pre>{$topicDetails.topic_content}</pre></p>
        </div>
        {volist name='RowsTopicNewsDetails' id='vo'}
        <hr/>
        <div class="topic">
            <span style="color: #1E9FFF;">{$vo.user_name}：</span>
            <br/>
            <span style="font-size: smaller">{:date("Y-m-d H:i", $vo.reply_time)}</span>
            <br/>
            <span style="font-weight: 700">{$vo.topic_news_content}</span>
            <br/>
            <em class="del"><i class="" id=""></i></em>
        </div>
        {/volist}
    </li>
</ul>
<div style="height: 88px;"></div>
<div class="input-group" style="position: fixed;left: 0;bottom:70px;">
    <input type="text" class="form-control" id="news" value="" placeholder="回复：">
    <span class="input-group-addon" id="submit">发送</span>
</div>
<div class="footer_fixed clearfix">
    <span><a href="{:url('home/Community/index')}" class="aon"><i class="home_icon"></i><b>社区</b></a></span>
    <span><a href="{:url('home/Babyhome/index')}"><i class="customer_community_icon"></i><b>专题</b></a></span>
    <span><a href="{:url('home/Parenting/index')}"><i class="store_community_icon"></i><b>育儿</b></a></span>
    <span><a href="{:url('home/Activity/index')}"><i class="carts_community_icon"></i><b>活动</b></a></span>
</div>
</body>
</html>
<script type="text/javascript">
    /*话题评论*/
    $('#submit').click(function(){
        var data = {};
        data.topic_id = $('#topic_id').val();
        data.content = $('#news').val();
        $.post("{:url('home/Topicnews/addComment')}", data, function(data){
            console.dir(data);
            if(data == 1){
                layer.open({type: 2});
                setTimeout('location.href = "{:url(\'home/Topicnews/getTopicDetails\', array(\'id\' => $topicDetails.id,\'community_id\' => $topicDetails.community_id))}"', 1000);
            }else if(data == 'login'){
                layer.open({
                    content: '请登录！'
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
                setTimeout('location.href = "{:url(\'home/Login/login\')}"',1000)
            }else if(data == 'empty_content'){
                layer.open({
                    content: '内容不能为空！'
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
            }else {
                layer.open({
                    content: '回复失败！'
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
            }
        });
    });
</script>